
import { math } from "cc";
import { Vector2 } from "./Vec";


export class Rect
{



    private  urect:math.Rect


    get xMin()
    {
        return this.urect.xMin
    }
    get xMax()
    {
        return this.urect.xMax
    }
    get yMax()
    {
        return this.urect.yMax
    }
    get yMin()
    {
        return this.urect.yMin
    }

    private constructor() {

    }

    public static initWithPosition(position: Vector2, size: Vector2) {
        // let rect = new Rect();
        // rect.urect = new math.Rect(position.GetOrigin(),size.GetOrigin());
        // return rect 
    }

    public static initWithReact(x: number, y: number, width: number, height: number) {
        let rect = new Rect();
        rect.urect = new math.Rect(x,y,width,height); 
        return rect;
    }




    // constructor(position?: Vec2, size?: Vec2);
    // constructor(x?: number, y?: number, width?: number, height?: number);
    // constructor(position?: Vec2, size?: Vec2,x?: number, y?: number, width?: number, height?: number)
    // {
    //     if (position && size)
    //     {
    //         this.urect = new UnityEngine.Rect(position.GetOrigin(),size.GetOrigin());
    //     }
    //     else if (x && y && width && height )
    //     {
    //         this.urect = new UnityEngine.Rect(x,y,width,height);
    //     }
    //     else
    //     {
    //         Util.Log("error Rect");
    //     }
  

    // }
  

   
}